﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SocialPlatformSDK.Model;
using SocialPlatformSDK.Services.Util;
using SocialPlatformSDK.Util;

namespace SocialPlatformSDK
{
    public class TencentOAuthInfo : OAuthConfigruationBase<TencentOAuthInfo>
    {

        public override void Init()
        {
            base.IfSaveAccessToken = true;
            base.Format = DataFormat.Json;
            base.APP_KEY = "";
            base.APP_SECRET = "";
            base.Authority = "https://open.t.qq.com/";
            base.TokenIso = new SafeIsolatedStorage<AccessToken>("Tencent_internal_token.dat");

            APIUrl = "https://open.t.qq.com/api/";

            CallBackUrl = "";
            //OAuthUri = @"https://open.t.qq.com/cgi-bin/authorize?oauth_token={0}";
            //GetRequestToken = @"cgi-bin/request_token";
            GetAccessToken = @"cgi-bin/oauth2/access_token";

            //https://open.t.qq.com/cgi-bin/oauth2/authorize?client_id=APP_KEY&response_type=code&redirect_uri=http://www.myurl.com/example
            Accredit = string.Format("{0}cgi-bin/oauth2/authorize?client_id={1}&response_type=code&redirect_uri={2}",Authority,APP_KEY,CallBackUrl);

            base.AccessToken = new TencentAccessToken();
            base.CodeToken = new TencentCodeToken();
        }


      
    }
}
